<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/**
 * -------------------------------------------------
 * 微信小程序 Routes
 * -------------------------------------------------
 * 
 * 这是专门给微信小程序的API路由
 * 这些路由将被RouteServiceProvider加载并分配到"wx"
 */

// 注意重定向必须是完整路由
Route::redirect('/here', '/wx/abc');


Route::get('/abc', function (Request $request) {
    return "hello world!";
});

Route::prefix('auth')->group(function() {
    Route::post('login', function(Request $request) {
        return response()->json(['message' => '登录成功']);
    });

    Route::post('register', function(Request $request) {
        return response()->json(['message' => '注册成功']);
    });
});